#ifndef TIMER_HPP
#define TIMER_HPP

class Timer {
public:
	__host__ cudaEvent_t go()
	{
		cudaEvent_t start;

		cudaEventCreate(&start);
		cudaEventRecord( start, 0 );

		return start;
	}

  //returns time after start event to current point in Ms
	__host__ float get(cudaEvent_t &start)
	{
		cudaEvent_t stop;
		cudaEventCreate(&stop);
		cudaEventRecord( stop, 0 );
		cudaEventSynchronize( stop );

		float time;
		cudaEventElapsedTime( &time, start, stop );

		cudaEventDestroy( start );
		cudaEventDestroy( stop );

		return time;
	}
};

#endif